---
title: Document Stores
---

Document stores contain ingested document chunks, i.e. [Node](/typescript/framework/modules/data)s.

## Available Document Stores

- [SimpleDocumentStore](/typescript/framework-api-reference/classes/simpledocumentstore/): A simple in-memory document store with support for [persisting](/typescript/framework/modules/data/stores#local-storage) data to disk.
- [PostgresDocumentStore](/typescript/framework-api-reference/classes/postgresdocumentstore/): A PostgreSQL document store, see [PostgreSQL Storage](/typescript/framework/modules/data/stores#postgresql-storage).

Check the [LlamaIndexTS Github](https://github.com/run-llama/LlamaIndexTS) for the most up to date overview of integrations.

## Using PostgreSQL as Document Store

```package-install
npm i llamaindex @llamaindex/postgres
```

You can configure the `schemaName`, `tableName`, `namespace`, and
`connectionString`. If a `connectionString` is not
provided, it will use the environment variables `PGHOST`, `PGUSER`,
`PGPASSWORD`, `PGDATABASE` and `PGPORT`.

```typescript
import { Document, VectorStoreIndex, storageContextFromDefaults } from "llamaindex";
import { PostgresDocumentStore } from "@llamaindex/postgres";

const storageContext = await storageContextFromDefaults({
  docStore: new PostgresDocumentStore(),
});
```

## API Reference

- [BaseDocumentStore](/typescript/framework-api-reference/classes/basedocumentstore/)
